//
//  WMFeedAd.h
//  WonderMobSDK
//
//  Created by zero on 2020/3/2.
//

#import <UIKit/UIKit.h>

#import "WMBaseAd.h"

@class WMFeedAd, WMAdId;

NS_ASSUME_NONNULL_BEGIN

@protocol WMFeedAdDelegate <NSObject>

@optional

/// 广告数据加载成功回调
/// @param feedAd WMFeedAd 实例
- (void)wm_feedAdDidLoadSuccess:(WMFeedAd *)feedAd;

/// 广告各种错误信息回调
/// @param feedAd WMFeedAd 实例
/// @param error 具体错误信息
- (void)wm_feedAd:(WMFeedAd *)feedAd didFailWithError:(NSError * _Nullable)error;

/// 信息流广告视频展示成功
/// @param feedAd WMFeedAd 实例
- (void)wm_feedAdDidRenderSuccess:(WMFeedAd *)feedAd;

/// 需要在点击叉以后 在这个回调中移除视图，否则，会出现用户点击叉无效的情况
/// @param expressAdView WMFeedAd 实例
/// @param filterWords [BUDislikeWords] 关闭的原因
- (void)wm_feedAd:(UIView *)expressAdView
dislikeWithReason:(NSArray<NSObject *> * _Nullable )filterWords;

@end

@interface WMFeedAd : WMBaseAd

/// 构造方法
/// @param adIdModel adModel
/// @param posId posId
/// @param adSize size
/// @param viewController 用于展示广告的 controller
- (instancetype)initWithAdIdModel:(WMAdId *)adIdModel
                            posId:(NSString *)posId
                            adSize:(CGSize)adSize
                   viewController:(UIViewController *)viewController;

/// 加载广告
/// @param frame frame
- (UIView *)getFeedAd:(CGRect)frame;

/// 隐藏广告
- (void)removeFeedAd;

/// 委托对象
@property (nonatomic, weak) id<WMFeedAdDelegate> delegate;

@end

NS_ASSUME_NONNULL_END
